<!--
名称: 搜索框组件
作者: huangdi_cd
日期: 2021/4/15
说明: 用于快速统一构建弹窗页面
-->
<template>
    <el-input
        :style="{width:`${setWidth}px`}"
        @keyup.enter.native="searchHandler(searchKey)"
        v-model="searchKey"
        :searchKey ="searchKey"
        suffix-icon="el-icon-search"
        size="mini"
    >
    </el-input>
</template>

<script>
    export default {
        name: 'ASearch',
        props: {
            setWidth: {
                type: Number,
                default: 100
            },
            searchKey: {
                type: String
            }

        },
        data () {
            return {
                searchKey: ''
            }
        },
        methods: {
            searchHandler (searchKey) {
                this.$emit('search', searchKey)
            }
        }

    }
</script>

<style scoped>
</style>
